﻿using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Graphics;
using Microsoft.Xna.Framework.Content;

namespace AngryBullets.Sprite
{
    abstract class Sprite
    {
        #region Fields

        protected Texture2D _objetTexture;
        protected Vector2 _objetPosition;
        protected string AssetName;

        #endregion

        #region Properties

        public Vector2 ObjectPosition
        {
            get { return _objetPosition; }
            set { _objetPosition = value; }
        }

        public Texture2D ObjectTexture
        {
            get { return _objetTexture; }
        }

        #endregion

        #region Initialisation

        public Sprite(Vector2 position, string assetName)
        {
            _objetPosition = position;
            AssetName = assetName;
        }

        #endregion

        #region LoadContent & Draw

        public void LoadContent(ContentManager content)
        {
            _objetTexture = content.Load<Texture2D>(AssetName);
        }


        public void Draw(SpriteBatch spriteBatch)
        {
            spriteBatch.Draw(_objetTexture, _objetPosition, Color.White);
        }

        #endregion
    }
}
